package com.yike.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yike.user.dto.*;
import com.yike.user.param.PlatformReportDataParam;
import com.yike.user.param.PlatformRolePageParam;
import com.yike.user.param.SearchPageParam;
import com.yike.user.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 代理商表 Mapper 接口
 *
 * @author Sakura
 * @since 2024-10-18
 */
@Mapper
public interface PlatformDataMapper extends BaseMapper<Object> {

    IPage<SearchListVo> getSearchList(@Param("page") Page page, @Param("param") SearchPageParam param);

    BigDecimal getActualAmount(@Param("shopId") Long shopId, @Param("agentId") Long agentId,
                               @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    Integer getOrderNumber(@Param("shopId") Long shopId, @Param("agentId") Long agentId,
                           @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    BigDecimal getRefundAmount(@Param("shopId") Long shopId, @Param("agentId") Long agentId,
                               @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    BigDecimal getCommissionAmount(@Param("shopId") Long shopId, @Param("agentId") Long agentId,
                                   @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    Integer getAgentNumber(@Param("shopId") Long shopId, @Param("agentId") Long agentId,
                           @Param("endTime") String endTime);

    Integer getAddAgentNumber(@Param("shopId") Long shopId, @Param("agentId") Long agentId,
                              @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    Integer getShopNumber(@Param("shopId") Long shopId, @Param("agentId") Long agentId,
                          @Param("endTime") String endTime);

    Integer getAddShopNumber(@Param("shopId") Long shopId, @Param("agentId") Long agentId,
                             @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    Integer getUserNumber(@Param("endTime") String endTime);

    Integer getAddUserNumber(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<SalesActualCountVo> getSalesActualCount(@Param("shopId") Long shopId,
                                                 @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<PayTypeDataVo> getPayTypeData(@Param("shopId") Long shopId,
                                       @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<CategorySalesDataVo> getCategorySalesData(@Param("shopId") Long shopId,
                                                   @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    SalesReportDataVo getSalesReportDataVo(@Param("param") PlatformReportDataParam param);

    IPage<SalesReportDataVo> getSalesReportList(@Param("page") Page page, @Param("param") PlatformReportDataParam param);

    List<SalesReportDataDTO> getExportSalesReports(@Param("param") PlatformReportDataParam param);

    AgentReportDataVo getAgentReportDataVo(@Param("param") PlatformReportDataParam param);

    IPage<AgentReportDataVo> getAgentReportList(@Param("page") Page page, @Param("param") PlatformReportDataParam param);

    List<AgentReportDataDTO> getExportAgentReports(@Param("param") PlatformReportDataParam param);

    FinanceReportDataVo getFinanceReportCount(@Param("param") PlatformReportDataParam param);

    IPage<FinanceReportDataVo> getFinanceReportList(@Param("page") Page page, @Param("param") PlatformReportDataParam param);

    List<FinanceReportDataDTO> getExportFinanceReports(@Param("param") PlatformReportDataParam param);

    IPage<SalesRankDataVo> getSalesCategoryRankList(@Param("page") Page page, @Param("param") PlatformReportDataParam param);

    List<SalesCategoryRankDataDTO> getExportSalesCategoryRanks(@Param("param") PlatformReportDataParam param);

    IPage<SalesRankDataVo> getSalesGoodsRankList(@Param("page") Page page, @Param("param") PlatformReportDataParam param);

    List<SalesGoodsRankDataDTO> getExportSalesGoodsRanks(@Param("param") PlatformReportDataParam param);

}
